package Test;

import Factory.*;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个数字");
        int num1 = input.nextInt();
        System.out.println("请输入第二个数字");
        int num2 = input.nextInt();
        System.out.println("请选择符号1.加 2减 3乘 4除");
        int num3 = input.nextInt();
        jisuanFactory factory = null;
        if (num3==1){
            factory=new jiaFactory();
        }else if (num3==2){
            factory=new jianFactory();
        }else if (num3==3){
            factory=new chengFactory();
        }else if (num3==4){
            factory=new chuFactory();
        }
        System.out.println(factory.num(num3).num(num1,num2));

    }
}
